/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

/**
 * <p>Project: jse2303 - Reflect01</p>
 * <p>Powered by webrx On 2023-07-28 11:02:27</p>
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Reflect04 {
    public static void main(String[] args) throws Exception {
        //反射获取 构造方法 构造器
        Class<Apple> c = Apple.class;

        //Constructor<?>[] cs = c.getConstructors();
        //System.out.println(cs.length);
        //Object o = cs[1].newInstance();

        //Constructor<Apple> cc = c.getConstructor(String.class, int.class);
        //Apple ap = cc.newInstance("红1", 20);

        Apple aa2 = c.getConstructor().newInstance();


    }
}
